.library {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f5f5f5;
}

/* 工具栏样式 */
.library .toolbar {
  background-color: white;
  border-bottom: 1px solid #e0e0e0;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
}

.library .toolbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.library .page-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  color: #333;
}

.library .photo-count {
  font-size: 14px;
  color: #666;
  background-color: #f0f0f0;
  padding: 4px 8px;
  border-radius: 12px;
}

.library .toolbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 400px;
  margin: 0 20px;
}

.library .search-box {
  position: relative;
  width: 100%;
}

.library .search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  background-color: #f8f8f8;
  transition: all 0.2s ease;
}

.library .search-box input:focus {
  background-color: white;
  border-color: #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.library .search-box::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
  font-size: 16px;
}

.library .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 视图模式切换 */
.view-mode-toggle {
  display: flex;
  background-color: #f0f0f0;
  border-radius: 6px;
  padding: 2px;
}

.view-mode-btn {
  padding: 8px 12px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  transition: all 0.2s ease;
}

.view-mode-btn:hover {
  background-color: #e0e0e0;
}

.view-mode-btn.active {
  background-color: white;
  color: #007AFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.import-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
}

/* 内容区域 */
.library-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* 加载状态 */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
}

.loading-state p {
  margin-top: 16px;
  font-size: 16px;
}

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 24px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
}

.empty-state-description {
  font-size: 16px;
  color: #666;
  margin-bottom: 32px;
  max-width: 400px;
  line-height: 1.5;
}

/* 照片容器 */
.photos-container {
  height: 100%;
  overflow-y: auto;
  padding: 20px;
}

/* 网格视图 */
.photos-container.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.photos-container.grid .photo-item {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.photos-container.grid .photo-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.photos-container.grid .photo-item.selected {
  border: 2px solid #007AFF;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.photos-container.grid .photo-thumbnail {
  width: 100%;
  height: 150px;
  overflow: hidden;
  background-color: #f0f0f0;
}

.photos-container.grid .photo-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.photos-container.grid .photo-item:hover .photo-thumbnail img {
  transform: scale(1.05);
}

.photos-container.grid .photo-info {
  padding: 12px;
}

.photos-container.grid .photo-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photos-container.grid .photo-meta {
  font-size: 12px;
  color: #666;
}

.photos-container.grid .photo-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.photos-container.grid .photo-item:hover .photo-actions,
.photos-container.grid .photo-item.selected .photo-actions {
  opacity: 1;
}

.photos-container.grid .photo-actions input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

/* 列表视图 */
.photos-container.list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.photos-container.list .photo-item {
  display: flex;
  align-items: center;
  background-color: white;
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
}

.photos-container.list .photo-item:hover {
  background-color: #f8f8f8;
}

.photos-container.list .photo-item.selected {
  background-color: #e3f2fd;
  border-left: 3px solid #007AFF;
}

.photos-container.list .photo-thumbnail {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
  background-color: #f0f0f0;
  margin-right: 16px;
  flex-shrink: 0;
}

.photos-container.list .photo-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photos-container.list .photo-info {
  flex: 1;
  min-width: 0;
}

.photos-container.list .photo-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photos-container.list .photo-meta {
  font-size: 12px;
  color: #666;
}

.photos-container.list .photo-actions {
  margin-left: 16px;
}

.photos-container.list .photo-actions input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

/* 状态栏 */
.library .status-bar {
  background-color: #f8f8f8;
  border-top: 1px solid #e0e0e0;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
  min-height: 36px;
}

.library .status-left,
.library .status-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .library .toolbar {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
    min-height: auto;
  }
  
  .library .toolbar-left,
  .library .toolbar-center,
  .library .toolbar-right {
    width: 100%;
    justify-content: center;
  }
  
  .library .toolbar-center {
    margin: 0;
    max-width: none;
  }
  
  .photos-container {
    padding: 16px;
  }
  
  .photos-container.grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
  
  .library .status-bar {
    padding: 6px 16px;
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}